[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Function            strspace2tab - compress spaces to tabs

  Syntax              char *strspace2tab(char *source, char *dest,
                                         int tablen);

  Prototype in        stringhk.h

  Remarks             copies the string source to dest with all groups of
                      tablen spaces replaced with tabs ('\t').

                      The converted string will be returned in dest, so
                      you must make sure there is sufficient space
                      allocated.

  Return value        returns dest.

  See also            strtabexpand()

  Example             #include <stringhk.h>

                      main()
                      {
                           char spacestr[30] = "Spaces   are     nice.";
                           char tabstr[30];

                           printf("Converted string: %s\n",
                                  strspace2tab(spacestr,tabstr,3);
                      }

  Program output      Converted string: Spaces\tare\t  nice.

                      (In the output, \t represents a tab character.)


See Also: strtabexpand()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson